using Microsoft.Extensions.DependencyInjection;
using System;
using System.Threading.Tasks;
using Volo.Abp.Sms;
using Xunit;

namespace EasyAbp.Abp.PhoneNumberLogin.Provider.Aliyun.Tests
{
    public class UnitTest1:AliyunTestBase<AliyunTestBaseModule>
    {
        [Fact]
        public void Test1()
        {

        }

        [Fact]
        public async Task Should_Send_SMS()
        {
            const string code = "123456";

            var smsSender = ServiceProvider.GetRequiredService<ISmsSender>();

            var smsMessage = new SmsMessage(AbpAliyunTestsConsts.PhoneNumber, "placeholder");

            smsMessage.Properties.Add(PhoneNumberLoginProviderAliyunConsts.SignName, "");
            smsMessage.Properties.Add(PhoneNumberLoginProviderAliyunConsts.TemplateCode, "");
            smsMessage.Properties.Add(PhoneNumberLoginProviderAliyunConsts.TemplateParam, new{ code=code });

            await smsSender.SendAsync(smsMessage);

        }
    }
}
